package JFrame;

import java.awt.BorderLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;

public class BorderLayoutDemo {
	public static void main(String[] args) {
		JFrame frame = new JFrame();
		JPanel panel = new JPanel();
		frame.add(panel);
		
		
		panel.setLayout(new BorderLayout());
		
		JButton button = new JButton("button1");
		JButton button2 = new JButton("button2");
		JButton button3 = new JButton("button3");
		JButton button4 = new JButton("button4");
		
		panel.add(button,BorderLayout.EAST);
		panel.add(button2,BorderLayout.WEST);
		panel.add(button3,BorderLayout.SOUTH);
		panel.add(button4,BorderLayout.NORTH);
		
		
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setSize(300, 300);
		frame.setTitle("BorderLayiut_Test");
		frame.setLocation(500, 400);
		frame.setVisible(true);
	}
}
